package com.nacos.service.ServiceContoller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/service")
public class serviceController {
    @Value("${server.port}")

    String serverPort;
    @GetMapping("/getPort")
    public String getPortService(){
        return"调用端口 " + serverPort + " 成功！";
    }

    @Value("${client2.name} ")
    private String name;
    @Value("${client2.age}")
    private Integer age;

    @RequestMapping("/test")
    public String test(){

        return name+"   "+age;
    }
}
